import {Component, OnInit} from '@angular/core';

@Component({
  selector: 'app-four-sum',
  templateUrl: './four-sum.component.html',
  styleUrls: ['./four-sum.component.css']
})
export class FourSumComponent implements OnInit {

  constructor() {
  }

  ngOnInit() {
    const nums = [1, 2, 3, 4, 5, 6, 7];
    console.log(this.fourSum(nums, 0));
  }


  fourSum(nums: Array<number>, target) {
    if (!nums || nums.length < 3) {
      return [];
    }
    nums.sort((a, b) => a - b);
    const result = [];
    for (let i = 0; i < nums.length; i++) {
      for (let j = i + 1; j < nums.length; j++) {
        // 开始  //todo 用 i j 去组合剩下2个 ,采用三数之和的方法来完成


        // 结束
      }
    }

    return result.length;

  }
}
